<template>
    <exDialog
        @close="closeDialog"
        :winName="title || '图表'"
        :visible.sync="isShowWin"
        :width="(width || 1200)+'px'"
        >
        <chartCom v-if="isInit" ref="chartEl" :chrCfg="chrCfg" size="large"></chartCom>
    </exDialog>
</template>

<script>
import chartCom from "./chartCommon.vue";

export default {
    components:{
        chartCom
    },
    props:["title","width","chrCfg"],
    data() {
        return {
            isInit: false,
            loading: false,
            chartloading : false,
            isShowWin : false,
        }
    },


    mounted() {

    },
    computed:{
    },

    methods: {
        showWin(){
            this.isShowWin = true;
            if(!this.isInit){
                this.isInit = true;
            }
            this.$nextTick(()=>{
                this.$refs.chartEl.reDraw();
            });
        },
        closeDialog(){
            this.isShowWin = false;
            this.$emit("close")
        },
        reDraw(){
            this.$nextTick(()=>{
                this.$refs.chartEl.reDraw();
            });
        }
    }
}
</script>
<style lang="less" scoped>



</style>


